<?php

/**
 * @author christian
 * @copyright 2011
 *  
 * 
 **/

$ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDTour";
include_once("$ruta/star.php");
include_once("$ruta/MDTourGeneral/CTourEditDraw.php");


if (!isset($_POST['idTourTrack'])) {$_POST['idTourTrack'] = "NULL"; }
if (!isset($_POST['DateBegTrack'])) {$_POST['DateBegTrack'] = "NULL"; }
if (!isset($_POST['DateEndTrack'])) {$_POST['DateEndTrack'] = "NULL"; }
if (!isset($_POST['OriTrack'])) {$_POST['OriTrack'] = "NULL"; }
if (!isset($_POST['IntTrack'])) {$_POST['IntTrack'] = "NULL"; }
if (!isset($_POST['DestTrack'])) {$_POST['DestTrack'] = "NULL"; }
if (!isset($_POST['type'])) {$_POST['type'] = "NULL"; }

$idTourTrack = $_POST['idTourTrack'];
$DateBegTrack = $_POST['DateBegTrack'];
$DateEndTrack = $_POST['DateEndTrack'];
$OriTrack = $_POST['OriTrack'];
$IntTrack = $_POST['IntTrack'];
$DestTrack = $_POST['DestTrack'];
$TRACK_idTrack = $_POST['type'];

$query = "UPDATE tour_has_track SET DateBegTrack = '$DateBegTrack', DateEndTrack= '$DateEndTrack', TRACK_idTrack='$TRACK_idTrack' WHERE idTourTrack = $idTourTrack";
echo $query;
CModelo::getInstance()->insertData($query);


$idTour = CTourEditDraw::getInstance()->getAnyId("tour_has_track","idTourTrack",$idTourTrack,"tour_idTour");
echo $idTour;
//echo "<script> parent.location.href = '/viventura/MDTour/MDItinerary/MDEItinerary.php?codigo=$idTour' </script>";
  
?>